package com.wn.web;

import com.github.pagehelper.PageInfo;
import com.wn.pojo.Move;
import com.wn.pojo.User;
import com.wn.service.MoveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("move")
public class MoveController {
    @Autowired
    private MoveService moveService;

    //预约
    @RequestMapping("order")
    public Map<String, Object> order(Move move){
        Map<String, Object> map = moveService.order(move);
        return map;
    }

    //分页排序列表(admin)
    @RequestMapping("query-list")
    public PageInfo findAll(Integer page,Integer limit){
        PageInfo pageInfo = moveService.getProductByPage(page, limit);
        return pageInfo;
    }

    //修改
    @RequestMapping("update")
    public Map<String,Object> update(Move move){
        Map<String, Object> map = moveService.update(move);
        return map;
    }

    //查看详情
    @RequestMapping("xiang")
    public Map<String,Object> xiang(Integer id){
        Map<String, Object> map = moveService.xiang(id);
        return  map;
    }
}
